package abd.pr1.Interface;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

public class MainWindow extends JFrame{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public UserPanel userPanel;
	public BuscarSeriesPanel buscarSeriesPanel;
	public MisSeriesPanel misSeriesPanel;
	
	
	
	public MainWindow (){
		super();
		this.build();
		
		this.setSize(500, 500);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("Seguidores de series");
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}


	private void build() {

		this.getContentPane().setLayout(new BorderLayout());
		
		userPanel = new UserPanel();
		
		this.getContentPane().add(userPanel, BorderLayout.NORTH);
		
		JTabbedPane tabbed=  new JTabbedPane();
		

		buscarSeriesPanel = new BuscarSeriesPanel();
		
		misSeriesPanel = new MisSeriesPanel();
		
		tabbed.addTab("Buscar Series", null, buscarSeriesPanel);

		tabbed.addTab("Mis Series", null, misSeriesPanel);
		
		this.getContentPane().add(tabbed,BorderLayout.CENTER);
		
	}
	
	public void setUserPanelActionListener(ActionListener a){
		//userPanel.addListener(a);
	}
	
	public void setBuscarSeriesActionListener(ActionListener a){
		buscarSeriesPanel.addListener(a);
	}
	
	public void setMisSeriesActionListener(ActionListener a){
		misSeriesPanel.addListener(a);
	}

}

